/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;

/**
 *
 * @author Gautier
 */
public class SerializeOutput implements Runnable{
    
    private ArrayList al;
    
    public SerializeOutput(ArrayList a) {
        this.al=a;
    }
    
    @Override
    public void run() {
        try {
            FileOutputStream fichier = new FileOutputStream("contacts.ser");
            ObjectOutputStream oos = new ObjectOutputStream(fichier);
            oos.writeObject(al);
            oos.flush();
            oos.close();
        } catch (java.io.IOException e) {
            System.out.println("Error in output");
        }
    }
    
}
